var toolbar = [];

var QueryCondition = {
	get : function() {
		var p = {
			account_id : $("#account_id").val(),
			keywords : $("#keyworkds").val().trim(),
			gmtCreateBegin : $('#gmtCreateBegin').datebox('getValue'),
			gmtCreateEnd : $('#gmtCreateEnd').datebox('getValue')
		};
		return p;
	}
};
$(function() {
	$('#conditionDiv').appendTo($($(".datagrid-toolbar")[0]).find("tr"));
	$("#btnQuery").click(
			function() {
				var p = QueryCondition.get();
				$("#tt").datagrid("load", QueryCondition.get());
				 
				p["t"] = new Date();
				p["listId"] ="SLAVE_ACCOUNT_BALANCE.sheetSum" ;
				$.post("../query.htm", p, function(data) {
					var sumTd = $("#sumTd");
					if (sumTd.length == 0) {
						$(".datagrid-pager").find("table").find("tr").append(
								"<td id='sumTd'>总增加:<span class='drSum'></span>，总减少:<span class='crSum'></span></td>");
						sumTd = $("#sumTd");
					}
					sumTd.find(".drSum").html(data.rows[0].dr_sum);
					sumTd.find(".crSum").html(data.rows[0].cr_sum);
				}, "json");

			});
});
